
<?php
$this->breadcrumbs=array(
	'Customers'=>array('index'),
	'Manage',
);

$this->menu=array(
array('label'=>'List Customers', 'url'=>array('index')),
array('label'=>'Create Customers', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('customers-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>


<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display: none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div>
<!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'customers-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(            
            'name'=>'loginname',
			'header'=>'用户名',
            'value'=>$data->loginname,
        ),
        array(            
            'name'=>'nick',
			'header'=>'昵称',
            'value'=>$data->nick,
        ),
        array(
        	'name'=>'realname',
        	'header'=>'姓名',
        	'value'=>$data->realname,
        ),
        array(            
            'name'=>'balance',
			'header'=>'额度',
            'value'=>$data->balance,
        ),
        'vip',
        array(            
            'name'=>'credit_level',
			'header'=>'信用',
            'value'=>$data->credit_level,
        ),
        array(            
            'name'=>'jointime',
			'header'=>'注册时间',
            'value'=>$data->jointime,
        	'htmlOptions'=>array(
        		'width'=>'120',
        		'style'=>'text-align:center',
        	),
        ),
        array(            
            'name'=>'logintimes',
			'header'=>'登录次数',
            'value'=>$data->logintimes,
        ),
        array(            
            'name'=>'lastlogintime',
			'header'=>'最后登录时间',
            'value'=>$data->lastlogintime,
        	'htmlOptions'=>array(
        		'width'=>'120',
        		'style'=>'text-align:center',
        	),
        ),
        array(            
            'name'=>'lastloginip',
			'header'=>'最后登录IP',
            'value'=>$data->lastloginip,
        ),    
        array(
        	'name'=>'flag',
        	'header'=>'状态',
        	'value'=>$data->flag,
        ),    
),
)); ?>
